package com.changgou.canal.util;

import com.alibaba.otter.canal.protocol.CanalEntry;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: HuangFu
 * @Date: 2020/1/31 16:51
 * @Description: Canal简单工具类
 */
public class CanalUtils {
    /*** 列集合转换为 map
     * @param columnsList
     * @return
     */
    public static Map<String,String> convertToMap(List<CanalEntry.Column> columnsList ) {
        Map<String,String> map=new HashMap(16);
        columnsList.forEach( c-> map.put( c.getName(),c.getValue() ) );
        return map;
    }

}
